Extension point definition¶
Description¶
Define the next extension point for the extension in the manifest.
- Ribbon
- Event
- Command
Reference
- For details on extension points, refer to Manifest Guide> Extension Point Definitions> Overview.
Tip
- You can download the JSON schema definition useful for editing the manifest from Download> JSON Schema Definition.
Implementation example¶
Here is an implementation example of a simple extension point that defines one button to execute the function of the extension.
- In the
extensionPoints
section, defineribbon
that represents the ribbon configuration andcommands
that represents the execution commands. - The ribbon defines controls such as tabs, groups, and buttons that make up the ribbon.
- Assign the command to be executed to the button.
In this example, the
extensionPoints.ribbon.tabs[0].groups[0].controls[0].command
property has the IDCommand.SayHello
of the command to be defined later.
- The command defines the ID and title of the execution command and the function name of the command handler.
In this example, the command with ID
Command.SayHello
is defined as the first execution command in theextensionPoints.commands
property. The nameSayHello
of theextensionPoints.commands[0].execFunc
property is the function name of the command handler implemented in the execution programmain.cs
of the entry point.
manifest.json
{
//extension definition
"name": "HelloWorld",
"main": "main.cs",
"lifecycle": "application",
//extension point definition
"extensionPoints": {
//ribbon
"ribbon": {
"tabs": [
//Ribbon tab
{
"id": "HelloWorld.MainTab",
"label": "HelloWorld",
"orderBefore": "System.View",
"groups": [
//Group in ribbon tab
{
"id": "HelloWorld.FirstGroup",
"label": "Group 1",
"controls": [
//button
{
"id": "HelloWorld.SayHelloButton",
"type": "button",
"label": "Say Hello",
"imageLarge": "images/About.png",
"command": "Command.SayHello"
}
]
}
]
}
]
},
//command
"commands": [
{
"id": "Command.SayHello",
"execFunc": "SayHello"
}
]
}
}